for item in range(3):  # 0 1 2
    print("range:", item)
for item in range(5):  # 控制循环次数
    print("hello")


str01 = "hello nfx"
for item in str01:
    print("item:", item)


cart = ["巧克力派", "鱿鱼丝", "碎冰冰", "Python从入门到入坟"]
for item in cart:
    print("扫码:", item)
cart_price = [12.99, 10, 0.5, 99.99]
total_price = 0  # 记录总价
for item in cart_price:
    # total_price = total_price + item
    total_price += item
print("总价:", total_price)